from ultralytics import YOLO
import cv2
import numpy as np

model = YOLO("yolo11m-pose.pt")

def inference(image):
    return model(image, show=True)

def draw_result_image(image, results):
    print(results)
    for result in results:
        boxes = result.keypoints
        print(boxes)


def with_video():
    cap = cv2.VideoCapture(0)
    while True:
        success, img = cap.read()
        if not success:
            break
        results = inference(img)

def with_image(filename):
    inference(filename)
    cv2.waitKey(0)


if __name__ == "__main__":
    filename = "n3"
    filein = "/Users/v/Documents/proj/testdata/ai/test_av/" + filename + ".jpg"
    with_video()
